<template>
	<view class="product_card" @click="linkDetail(item.id)">
		<image :src="item.img" mode="aspectFill" class="product_card_img" />
		<view class="product_card_info">
			<view class="product_card_info_title">
				<text class="product_card_info_name" v-text="item.name"></text>
				<uni-tag :inverted="true" :text="item.tag" />
			</view>
			<view class="product_card_info_other">
				<view class="product_card_info_item">
					<text class="product_card_info_item_label">现有门店</text>
					<text class="product_card_info_item_valule" style="color: #e40b0b;">
						{{item.stores ? item.stores + '家' : ''}}
					</text>
				</view>
				<view class="product_card_info_item">
					<text class="product_card_info_item_label">口碑值</text>
					<text class="product_card_info_item_valule">
						{{item.publicPraise ? item.publicPraise + '分' : ''}}
					</text>
				</view>
				<view class="product_card_info_item">
					<text class="product_card_info_item_label">人均</text>
					<text class="product_card_info_item_valule">
						{{item.price ? '￥' + item.price : ''}}
					</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"ProductCard",
		props: ['item'],
		data() {
			return {
				
			};
		},
		methods: {
			linkDetail(id) {
				uni.navigateTo({
					url: `/pages/productDetail/productDetail?id=${id}`,
					animationType: 'slide-in-right', // 指定动画类型
					animationDuration: 1000 // 动画时长
				})
			}
		}
	}
</script>

<style scoped>
	.product_card {
		padding: 20rpx;
		background: #ffffff;
		display: flex;
		justify-content: space-between;
		border-radius: 20rpx;
		margin-bottom: 20rpx;
	}
	.product_card .product_card_img {
		width: 150rpx;
		height: 150rpx;
	}
	.product_card .product_card_info {
		flex: 1;
		margin-left: 16rpx;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
	}
	.product_card .product_card_info_title {
		display: flex;
		justify-content: space-between;
	}
	.product_card .product_card_info_name {
		font-size: 32rpx;
		font-weight: 600;
	}
	.product_card .product_card_info_other {
		display: flex;
	}
	.product_card .product_card_info_item {
		display: flex;
		flex-direction: column;
		align-items: center;
		margin-right: 20rpx;
	}
	.product_card .product_card_info_item_label {
		font-size: 24rpx;
		color: #999999;
	}
	.product_card .product_card_info_item_valule {
		font-size: 28rpx;
		font-weight: 600;
		display: block;
		margin-top: 10rpx;
	}
</style>